Skip to content

Conversation

@kernel-patches-daemon-bpf-rc
Copy link

Pull request for series with
subject: bpf: test_run: Fix sleep-in-atomic BUG in timer path with RT kernel
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1011490

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 39e9d5f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1011490
version: 3

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 39e9d5f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1011490
version: 3

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 48a97ff
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1011490
version: 3

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 27aab47
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1011490
version: 3

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 48a97ff
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1011490
version: 3

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 48a97ff
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1011490
version: 3

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 48a97ff
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1011490
version: 3

The timer mode is initialized to NO_PREEMPT mode by default,
this disable preemption and force execution in atomic context
causing issue on PREEMPT_RT configurations when invoking
spin_lock_bh(), leading to the following warning:

BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 6107, name: syz.0.17
preempt_count: 1, expected: 0
RCU nest depth: 1, expected: 1
Preemption disabled at:
[<ffffffff891fce58>] bpf_test_timer_enter+0xf8/0x140 net/bpf/test_run.c:42

Fix this, by removing NO_PREEMPT/NO_MIGRATE mode check.
Also, the test timer context no longer needs explicit calls to
migrate_disable()/migrate_enable() with rcu_read_lock()/rcu_read_unlock().
Use helpers rcu_read_lock_dont_migrate() and rcu_read_unlock_migrate()
instead.

Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=1f1fbecb9413cdbfbef8
Suggested-by: Yonghong Song <[email protected]>
Suggested-by: Menglong Dong <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Tested-by: [email protected]
Co-developed-by: Brahmajit Das <[email protected]>
Signed-off-by: Brahmajit Das <[email protected]>
Signed-off-by: Sahil Chandna <[email protected]>
@kernel-patches-daemon-bpf-rc
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1011490 irrelevant now. Closing PR.

@kernel-patches-daemon-bpf-rc kernel-patches-daemon-bpf-rc bot deleted the series/1011490=>bpf-next branch October 17, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants